package com.supplychain.financial.parent.api;

import com.supplychain.financial.parent.entity.DO.UserDO;
import com.supplychain.financial.parent.entity.DTO.CustomUser;
import com.supplychain.financial.parent.entity.DTO.MenuDTO;
import com.supplychain.financial.parent.entity.DTO.PageDTO;
import com.supplychain.financial.parent.common.exception.CustomException;

import java.util.List;
import java.util.Map;

/**
 * 用户业务接口
 * @author zhengchuan
 *
 */
public interface UserService {
	/**
	 * 登陆成功后根据角色id获取角色权限信息
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	List<MenuDTO> findUserMenusByRoleId(String roleId)  throws CustomException;
	/**
	 * 根据用户phone获取到用户
	 * @param phone
	 * @return
	 */
	UserDO findUserByPhone(String phone) throws CustomException ;

	/**
	 * 新的获取用户信息的方法
	 * @param username
	 * @return
	 */
	CustomUser findCustomByPhone(String username)  throws CustomException;
	/**
	 * 注册用户
	 * @param userDO
	 */
	void registerUser(UserDO userDO) throws CustomException;

	/**
	 * 分页查询用户信息
	 * @param page
	 * @param pageSize
	 * @param sortedKey
	 * @param sortedValue
	 * @param filters
	 * @return
	 * @throws CustomException
	 */
    PageDTO<CustomUser> findUserByPage(Integer page, Integer pageSize, String sortedKey, String sortedValue, String filters) throws CustomException;

    void editUserInfo(CustomUser user, String oper) throws CustomException;


	void initializeUserPassword(UserDO user) throws CustomException;

    List<String> findPermissionStrList(String roleId) throws CustomException;

    Map<String,Object> findUSerRoleNameAndPrivilegeNames(String roleId) throws CustomException;

    CustomUser findCustomUserById(String userId) throws CustomException;

}
